package com.ruoyi.web.controller.common;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.OssService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: OSS控制器
 * @author: Marvin
 * @create: 2025-01-01 10:42
 */
@RestController
@RequestMapping("/thirdParty/oss")
@Api("OssController")
public class OssController {
    @Autowired
    private OssService ossService;

    @ApiOperation("获取OSS凭证")
    @GetMapping("/policy")
    @PreAuthorize("@ss.hasPermi('thirdParty:oss:policy')")
    public AjaxResult policy() {
        return ossService.getPolicy();
    }
}
